package com.hxzy.controller.admin.system;

import com.hxzy.common.core.controller.BaseController;
import com.hxzy.common.core.domain.entity.Role;
import com.hxzy.common.core.page.TableDataInfo;
import com.hxzy.common.security.TokenService;
import com.hxzy.system.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 角色控制器
 *
 * @author tonneyyy
 */
@RestController
@RequestMapping("/system/role")
public class RoleController extends BaseController {


    @Autowired
    private RoleService roleService;

    @Autowired
    private TokenService tokenService;


    @PreAuthorize("@ss.hasPermi('system:role:list')")
    @GetMapping("/list")
    public TableDataInfo list(Role role){
        startPage();
        List<Role> list = roleService.search(role);
        return getDataTable(list);
    }


}
